// /api/goods.js

import request from '@/utils/request'; // 使用了uni-app的请求封装

export function getGoodsList(params) {
  // 确保参数结构符合要求
  const requestParams = {
    pageNum: null,
    pageSize: null,
    param: params.param || {}
  };
  
  return request({
    url: '/goods/queryGoodsApp',
    method: 'POST',
    data: requestParams
  });
}

export function getGoodsCategories() {
  return request({
    url: '/goods/queryTypeToDropdownBox',
    method: 'GET'
  });
}

export function getGoodsDetail(id) {
  return request({
    url: `/goods/queryGoodsById/${id}`,
    method: 'GET'
  });
}

export function getGoodsCommit(id) {
  return request({
    url: `/goods/queryGoodsCommit/${id}`,
    method: 'GET'
  });
}